<?php
	include('db_connection.php');
	class New_Enquiry{
	
		function saveEnquiryQuery(){
			$ins_aff = "INSERT INTO tbl_enquiry (en_name,en_email,en_contact,en_query) VALUES ('".$_POST['enquiry_user_name']."','".$_POST['enquiry_user_email']."','".$_POST['enquiry_user_contact']."','".$_POST['enquiry_user_query']."')";
			$query = mysql_query($ins_aff) or die(mysql_error());
			
			/* This Code is used for send Email. Start Here*/
				$mail_to='Vipin7477@gmail.com';
				$mail_subject="Enquiry";
				$mail_body .= "By -> '".$_POST['enquiry_user_name']."' .<br/>\n";
				$mail_body .= "Email -> '".$_POST['enquiry_user_email']."' .<br/>\n";
				$mail_body .= "Query -> '".$_POST['enquiry_user_query']."' .<br/>\n";
				$headers  = 'MIME-Version: 1.0' . "\r\n";
				$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
				$headers .= 'From:RV Training<info@rvtraining.net>' . "\r\n";
				$sent = mail($mail_to,$mail_subject,$mail_body, $headers);	
									
			/* This Code is used for send Email. End Here*/	
			$msg = "You Account is created. After checking you website admin will activate your account.";
			return $msg;
		}
	}
?>